go/types.operand.typ (field)
352 uses
go/types (current package)
api_predicates.go#L34: x := operand{mode: value, typ: V}
api_predicates.go#L45: x := operand{mode: value, typ: V}
assignments.go#L43: if isUntyped(x.typ) {
assignments.go#L58: target = Default(x.typ)
assignments.go#L62: if T == nil && x.typ == Typ[UntypedNil] {
assignments.go#L67: target = Default(x.typ)
assignments.go#L89: if newType != x.typ {
assignments.go#L90: x.typ = newType
assignments.go#L97: if sig, _ := under(x.typ).(*Signature); sig != nil && sig.TypeParams().Len() > 0 {
assignments.go#L122: if x.mode == invalid || !isValid(x.typ) || !isValid(lhs.typ) {
assignments.go#L137: assert(isConstType(x.typ))
assignments.go#L141: lhs.typ = x.typ
assignments.go#L157: if x.mode == invalid || !isValid(x.typ) || !isValid(lhs.typ) {
assignments.go#L167: typ := x.typ
assignments.go#L222: if x.mode == invalid || !isValid(x.typ) {
assignments.go#L246: return x.typ
assignments.go#L284: res = append(res, x.typ)
builtins.go#L104: typeset(y.typ, func(_, u Type) bool {
builtins.go#L117: sig = makeSig(x.typ, x.typ, y.typ)
builtins.go#L133: sig = makeSig(x.typ, x.typ, NewSlice(E)) // []E required for variadic signature
builtins.go#L150: switch t := arrayPtrDeref(under(x.typ)).(type) {
builtins.go#L185: if !isTypeParam(x.typ) {
builtins.go#L188: if underIs(x.typ, func(u Type) bool {
builtins.go#L209: if isValid(under(x.typ)) {
builtins.go#L221: check.recordBuiltinType(call.Fun, makeSig(Typ[Int], x.typ))
builtins.go#L225: x.typ = Typ[Int]
builtins.go#L232: if !underIs(x.typ, func(u Type) bool {
builtins.go#L245: check.recordBuiltinType(call.Fun, makeSig(nil, x.typ))
builtins.go#L250: if !underIs(x.typ, func(u Type) bool {
builtins.go#L266: check.recordBuiltinType(call.Fun, makeSig(nil, x.typ))
builtins.go#L275: if isUntyped(x.typ) {
builtins.go#L278: if isUntyped(y.typ) {
builtins.go#L286: check.convertUntyped(x, y.typ)
builtins.go#L289: check.convertUntyped(y, x.typ)
builtins.go#L301: if isNumeric(x.typ) && constant.Sign(constant.Imag(x.val)) == 0 {
builtins.go#L302: x.typ = Typ[UntypedFloat]
builtins.go#L319: if !Identical(x.typ, y.typ) {
builtins.go#L320: check.errorf(x, InvalidComplex, invalidOp+"%v (mismatched types %s and %s)", call, x.typ, y.typ)
builtins.go#L342: check.errorf(x, InvalidComplex, invalidArg+"arguments have type %s, expected floating-point", x.typ)
builtins.go#L354: check.recordBuiltinType(call.Fun, makeSig(resTyp, x.typ, x.typ))
builtins.go#L357: x.typ = resTyp
builtins.go#L374: typeset(y.typ, func(_, u Type) bool {
builtins.go#L398: if !allString(y.typ) {
builtins.go#L411: check.recordBuiltinType(call.Fun, makeSig(Typ[Int], x.typ, y.typ))
builtins.go#L414: x.typ = Typ[Int]
builtins.go#L420: map_ := x.typ
builtins.go#L454: if isUntyped(x.typ) {
builtins.go#L458: if isNumeric(x.typ) {
builtins.go#L459: x.typ = Typ[UntypedComplex]
builtins.go#L496: check.errorf(x, code, invalidArg+"argument has type %s, expected complex type", x.typ)
builtins.go#L512: check.recordBuiltinType(call.Fun, makeSig(resTyp, x.typ))
builtins.go#L515: x.typ = resTyp
builtins.go#L571: x.typ = T
builtins.go#L573: check.recordBuiltinType(call.Fun, makeSig(x.typ, types...))
builtins.go#L591: if !allOrdered(a.typ) {
builtins.go#L603: if !Identical(x.typ, a.typ) {
builtins.go#L604: check.errorf(a, MismatchedTypes, invalidArg+"mismatched types %s (previous argument) and %s (type of %s)", x.typ, a.typ, a.expr)
builtins.go#L630: check.updateExprType(a.expr, x.typ, true)
builtins.go#L636: types[i] = x.typ
builtins.go#L638: check.recordBuiltinType(call.Fun, makeSig(x.typ, types...))
builtins.go#L650: x.typ = &Pointer{base: T}
builtins.go#L652: check.recordBuiltinType(call.Fun, makeSig(x.typ, T))
builtins.go#L691: params[i] = a.typ
builtins.go#L703: x.typ = &emptyInterface
builtins.go#L705: check.recordBuiltinType(call.Fun, makeSig(x.typ))
builtins.go#L723: x.typ = Typ[UnsafePointer]
builtins.go#L725: check.recordBuiltinType(call.Fun, makeSig(x.typ, x.typ, y.typ))
builtins.go#L735: if hasVarSize(x.typ, nil) {
builtins.go#L738: check.recordBuiltinType(call.Fun, makeSig(Typ[Uintptr], x.typ))
builtins.go#L742: x.val = constant.MakeInt64(check.conf.alignof(x.typ))
builtins.go#L745: x.typ = Typ[Uintptr]
builtins.go#L763: base := derefStructPtr(x.typ)
builtins.go#L814: x.typ = Typ[Uintptr]
builtins.go#L823: if hasVarSize(x.typ, nil) {
builtins.go#L826: check.recordBuiltinType(call.Fun, makeSig(Typ[Uintptr], x.typ))
builtins.go#L829: size := check.conf.sizeof(x.typ)
builtins.go#L838: x.typ = Typ[Uintptr]
builtins.go#L844: u, _ := commonUnder(x.typ, nil)
builtins.go#L857: x.typ = NewSlice(ptr.base)
builtins.go#L859: check.recordBuiltinType(call.Fun, makeSig(x.typ, ptr, y.typ))
builtins.go#L866: u, _ := commonUnder(x.typ, nil)
builtins.go#L874: x.typ = NewPointer(slice.elem)
builtins.go#L876: check.recordBuiltinType(call.Fun, makeSig(x.typ, slice))
builtins.go#L894: x.typ = Typ[String]
builtins.go#L896: check.recordBuiltinType(call.Fun, makeSig(x.typ, NewPointer(universeByte), y.typ))
builtins.go#L909: x.typ = NewPointer(universeByte)
builtins.go#L911: check.recordBuiltinType(call.Fun, makeSig(x.typ, Typ[String]))
builtins.go#L918: if x.mode != constant_ || !isBoolean(x.typ) {
builtins.go#L968: typeset(x.typ, func(_, u Type) bool {
builtins.go#L1039: if tp, _ := Unalias(x.typ).(*TypeParam); tp != nil {
builtins.go#L1083: return f(x.typ)
call.go#L62: sig := x.typ.(*Signature)
call.go#L104: args = []*operand{{mode: value, expr: expr, typ: T.sig}}
call.go#L127: x.typ = sig
call.go#L202: T := x.typ
call.go#L249: u, err := commonUnder(x.typ, func(t, u Type) *typeError {
call.go#L324: x.typ = sig.results.vars[0].typ // unpack tuple
call.go#L327: x.typ = sig.results
call.go#L334: if x.mode == value && sig.TypeParams().Len() > 0 && isParameterized(sig.TypeParams().list(), x.typ) {
call.go#L373: assert(n < x.typ.(*Signature).TypeParams().Len())
call.go#L410: if t, ok := x.typ.(*Tuple); ok && x.mode != invalid {
call.go#L414: resList[i] = &operand{mode: value, expr: e, typ: v.typ}
call.go#L573: if asig, _ := arg.typ.(*Signature); asig != nil && asig.TypeParams().Len() > 0 {
call.go#L588: arg.typ = asig // new type identity for the function argument
call.go#L643: asig := arg.typ.(*Signature)
call.go#L646: arg.typ = check.instantiateSignature(call.Pos(), arg.expr, asig, targs[j:k], nil) // TODO(gri) provide xlist if possible (partial instantiations)
call.go#L749: x.typ = exp.typ
call.go#L753: x.typ = exp.typ
call.go#L756: x.typ = exp.typ
call.go#L758: x.typ = x.typ.(*Pointer).base
call.go#L762: x.typ = exp.typ
call.go#L765: x.typ = x.typ.(*Signature).results.vars[0].typ
call.go#L769: x.typ = exp.typ
call.go#L784: if def != nil && def.typ == x.typ {
call.go#L815: obj, index, indirect = lookupFieldOrMethod(x.typ, x.mode == variable, check.pkg, sel, false)
call.go#L818: if !isValid(under(x.typ)) {
call.go#L830: check.errorf(e.Sel, InvalidMethodExpr, "invalid method expression %s.%s (needs pointer receiver (*%s).%s)", x.typ, sel, x.typ, sel)
call.go#L832: check.errorf(e.Sel, InvalidMethodExpr, "cannot call pointer method %s on %s", sel, x.typ)
call.go#L838: if isInterfacePtr(x.typ) {
call.go#L839: why = check.interfacePtrError(x.typ)
call.go#L841: alt, _, _ := lookupFieldOrMethod(x.typ, x.mode == variable, check.pkg, sel, true)
call.go#L842: why = check.lookupError(x.typ, sel, alt, false)
call.go#L857: check.errorf(e.Sel, MissingFieldOrMethod, "%s.%s undefined (type %s has no method %s)", x.expr, sel, x.typ, sel)
call.go#L861: check.recordSelection(e, MethodExpr, x.typ, m, index, indirect)
call.go#L889: params = append([]*Var{NewParam(sig.recv.pos, sig.recv.pkg, name, x.typ)}, params...)
call.go#L891: x.typ = &Signature{
call.go#L904: check.recordSelection(e, FieldVal, x.typ, obj, index, indirect)
call.go#L910: x.typ = obj.typ
call.go#L915: check.recordSelection(e, MethodVal, x.typ, obj, index, indirect)
call.go#L930: typ := x.typ
call.go#L967: x.typ = &sig
const.go#L37: if isTyped(x.typ) {
const.go#L38: check.representable(x, under(x.typ).(*Basic))
const.go#L258: if isNumeric(x.typ) && isNumeric(typ) {
const.go#L266: if !isInteger(x.typ) && isInteger(typ) {
const.go#L304: if newType != x.typ {
const.go#L305: x.typ = newType
conversions.go#L29: case isInteger(x.typ) && isString(t):
conversions.go#L51: if !ok && isInteger(x.typ) && isInteger(T) {
conversions.go#L68: if isString(x.typ) && isBytesOrRunes(u) {
conversions.go#L72: if isInteger(x.typ) && isInteger(u) {
conversions.go#L102: if isUntyped(x.typ) {
conversions.go#L112: if isTypes2 && x.typ == Typ[UntypedNil] {
conversions.go#L115: final = Default(x.typ) // default type of untyped nil is untyped nil
conversions.go#L116: } else if x.mode == constant_ && isInteger(x.typ) && allString(T) {
conversions.go#L117: final = x.typ
conversions.go#L122: x.typ = T
conversions.go#L146: V := Unalias(x.typ)
conversions.go#L256: x.typ = V.typ
conversions.go#L274: x.typ = V.typ
conversions.go#L287: errorf("cannot convert %s to type %s (in %s)", x.typ, T.typ, Tp)
expr.go#L75: if !pred(x.typ) {
expr.go#L146: x.typ = &Pointer{base: x.typ}
expr.go#L152: x.typ = elem
expr.go#L161: if !allInteger(x.typ) {
expr.go#L181: if isUnsigned(x.typ) {
expr.go#L182: prec = uint(check.conf.sizeof(x.typ) * 8)
expr.go#L198: u, err := commonUnder(x.typ, func(t, u Type) *typeError {
expr.go#L221: if isTypeParam(x.typ) {
expr.go#L228: if isTypeParam(x.typ) {
expr.go#L388: if x.mode == invalid || isTyped(x.typ) || !isValid(target) {
expr.go#L389: return x.typ, nil, 0
expr.go#L395: if m := maxType(x.typ, target); m != nil {
expr.go#L414: switch x.typ.(*Basic).kind {
expr.go#L468: return Default(x.typ), nil, 0
expr.go#L484: if !isValid(x.typ) || !isValid(y.typ) {
expr.go#L499: ok, _ := x.assignableTo(check, y.typ, nil)
expr.go#L501: ok, _ = y.assignableTo(check, x.typ, nil)
expr.go#L508: cause = check.sprintf("mismatched types %s and %s", x.typ, y.typ)
expr.go#L520: typ := x.typ
expr.go#L522: typ = y.typ
expr.go#L533: case !Comparable(x.typ):
expr.go#L535: cause = check.incomparableCause(x.typ)
expr.go#L538: case !Comparable(y.typ):
expr.go#L540: cause = check.incomparableCause(y.typ)
expr.go#L547: case !allOrdered(x.typ):
expr.go#L550: case !allOrdered(y.typ):
expr.go#L570: check.updateExprType(x.expr, Default(x.typ), true)
expr.go#L571: check.updateExprType(y.expr, Default(y.typ), true)
expr.go#L576: x.typ = Typ[UntypedBool]
expr.go#L582: if isTypeParam(x.typ) || isTypeParam(y.typ) {
expr.go#L584: if !isTypeParam(x.typ) {
expr.go#L587: cause = check.sprintf("type parameter %s cannot use operator %s", errOp.typ, op)
expr.go#L590: what := compositeKind(errOp.typ)
expr.go#L592: what = check.sprintf("%s", errOp.typ)
expr.go#L625: if allInteger(x.typ) || isUntyped(x.typ) && xval != nil && xval.Kind() == constant.Int {
expr.go#L650: if isUntyped(y.typ) {
expr.go#L662: case allInteger(y.typ):
expr.go#L663: if !allUnsigned(y.typ) && !check.verifyVersionf(y, go1_13, invalidOp+"signed shift count %s", y) {
expr.go#L667: case isUntyped(y.typ):
expr.go#L688: if !isInteger(x.typ) {
expr.go#L689: x.typ = Typ[UntypedInt]
expr.go#L705: if !isInteger(x.typ) {
expr.go#L706: x.typ = Typ[UntypedInt]
expr.go#L716: if isUntyped(x.typ) {
expr.go#L747: if !allInteger(x.typ) {
expr.go#L809: if !Identical(x.typ, y.typ) {
expr.go#L812: if isValid(x.typ) && isValid(y.typ) {
expr.go#L818: check.errorf(posn, MismatchedTypes, invalidOp+"%s (mismatched types %s and %s)", e, x.typ, y.typ)
expr.go#L820: check.errorf(posn, MismatchedTypes, invalidOp+"%s %s= %s (mismatched types %s and %s)", lhs, op, rhs, x.typ, y.typ)
expr.go#L834: if (x.mode == constant_ || allInteger(x.typ)) && y.mode == constant_ && constant.Sign(y.val) == 0 {
expr.go#L841: if x.mode == constant_ && y.mode == constant_ && isComplex(x.typ) {
expr.go#L860: if op == token.QUO && isInteger(x.typ) {
expr.go#L887: if isTyped(x.typ) && isTyped(y.typ) {
expr.go#L894: if isNonTypeParamInterface(x.typ) || isNonTypeParamInterface(y.typ) {
expr.go#L898: if allBoolean(x.typ) != allBoolean(y.typ) {
expr.go#L902: if allString(x.typ) != allString(y.typ) {
expr.go#L907: return hasNil(y.typ)
expr.go#L910: return hasNil(x.typ)
expr.go#L914: if isPointer(x.typ) || isPointer(y.typ) {
expr.go#L921: check.convertUntyped(x, y.typ)
expr.go#L925: check.convertUntyped(y, x.typ)
expr.go#L997: switch t := x.typ.(type) {
expr.go#L1014: x.typ = Typ[Invalid]
expr.go#L1025: x.typ = Typ[Invalid]
expr.go#L1096: if isTypeParam(x.typ) {
expr.go#L1100: if _, ok := under(x.typ).(*Interface); !ok {
expr.go#L1110: x.typ = T
expr.go#L1121: check.validVarType(e.X, x.typ)
expr.go#L1122: x.typ = &Pointer{base: x.typ}
expr.go#L1125: if !underIs(x.typ, func(u Type) bool {
expr.go#L1141: x.typ = base
expr.go#L1168: x.typ = check.typ(e)
expr.go#L1234: if check.assertableTo(x.typ, T, &cause) {
expr.go#L1243: check.errorf(e, ImpossibleAssert, "impossible type assertion: %s\n\t%s does not implement %s %s", e, T, x.typ, cause)
expr.go#L1274: if t, ok := x.typ.(*Tuple); ok && x.mode != invalid {
expr.go#L1278: list[i] = &operand{mode: value, expr: e, typ: v.typ}
expr.go#L1286: x2 := &operand{mode: value, expr: e, typ: Typ[UntypedBool]}
expr.go#L1288: x2.typ = universeError
expr.go#L1349: if t, ok := x.typ.(*Tuple); ok {
index.go#L32: x.typ = check.varType(e.orig)
index.go#L33: if isValid(x.typ) {
index.go#L39: if sig, _ := under(x.typ).(*Signature); sig != nil && sig.TypeParams().Len() > 0 {
index.go#L54: switch typ := under(x.typ).(type) {
index.go#L65: x.typ = universeByte // use 'byte' name
index.go#L74: x.typ = typ.elem
index.go#L81: x.typ = typ.elem
index.go#L87: x.typ = typ.elem
index.go#L100: x.typ = typ.elem
index.go#L105: if !isTypeParam(x.typ) {
index.go#L112: if underIs(x.typ, func(u Type) bool {
index.go#L174: x.typ = elem
index.go#L182: x.typ = elem
index.go#L203: if x.typ == nil {
index.go#L204: x.typ = Typ[Invalid]
index.go#L221: typeset(x.typ, func(t, u Type) bool {
index.go#L223: check.errorf(x, NonSliceableOperand, "cannot slice %s: no specific type in %s", x, x.typ)
index.go#L253: if !isTypeParam(x.typ) {
index.go#L254: cu = under(x.typ) // untyped string remains untyped
index.go#L283: if isUntyped(x.typ) {
index.go#L284: x.typ = Typ[String]
index.go#L296: x.typ = &Slice{elem: u.elem}
index.go#L302: x.typ = &Slice{elem: u.elem}
index.go#L400: return x.typ, -1
index.go#L415: return x.typ, v
index.go#L430: if !allInteger(x.typ) {
infer.go#L176: if isParameterized(tparams, par.typ) || isParameterized(tparams, arg.typ) {
infer.go#L179: if isTyped(arg.typ) {
infer.go#L180: if !u.unify(par.typ, arg.typ, assign) {
infer.go#L181: errorf(par.typ, arg.typ, arg)
infer.go#L343: max = arg.typ
infer.go#L345: m := maxType(max, arg.typ)
infer.go#L347: err.addf(arg, "mismatched types %s and %s (cannot infer %s)", max, arg.typ, tpar)
literals.go#L104: x.typ = sig
literals.go#L299: if Identical(vtyp, x.typ) {
literals.go#L304: visited[xkey] = append(visited[xkey], x.typ)
literals.go#L347: x.typ = typ
operand.go#L62: typ Type
operand.go#L117: switch x.typ {
operand.go#L123: return fmt.Sprintf("nil (of type %s)", TypeString(x.typ, qf))
operand.go#L127: if x.mode == value && x.typ == Typ[UntypedNil] {
operand.go#L142: expr = TypeString(x.typ, qf)
operand.go#L161: if x.typ != nil {
operand.go#L162: if isUntyped(x.typ) {
operand.go#L163: buf.WriteString(x.typ.(*Basic).name)
operand.go#L184: if isValid(x.typ) {
operand.go#L186: if isGeneric(x.typ) {
operand.go#L194: tpar, _ := Unalias(x.typ).(*TypeParam)
operand.go#L196: switch x.typ.(type) {
operand.go#L198: what := compositeKind(x.typ)
operand.go#L201: what = under(x.typ).(*Basic).name
operand.go#L209: WriteType(&buf, x.typ, qf)
operand.go#L289: x.typ = Typ[Invalid]
operand.go#L293: x.typ = Typ[kind]
operand.go#L302: return x.mode == value && x.typ == Typ[UntypedNil]
operand.go#L318: V := Unalias(x.typ)
operand.go#L423: errorf("cannot assign %s to %s (in %s)", x.typ, T.typ, Tp)
operand.go#L442: x.typ = V.typ
range.go#L42: if t, ok := arrayPtrDeref(under(x.typ)).(*Array); ok {
range.go#L59: typ: Typ[Int],
range.go#L69: k, v, cause, ok := rangeKeyVal(check, x.typ, func(v goVersion) bool {
range.go#L99: rangeOverInt := isInteger(x.typ)
range.go#L142: y.typ = typ
range.go#L176: if x.mode != invalid && !isInteger(x.typ) {
range.go#L177: check.softErrorf(lhs, InvalidRangeExpr, "cannot use iteration variable of type %s", x.typ)
range.go#L183: y.typ = typ
recording.go#L29: typ = x.typ
recording.go#L32: typ = x.typ
recording.go#L103: t0, t1 := a[0].typ, a[1].typ
stmt.go#L245: check.convertUntyped(&v, x.typ)
stmt.go#L263: if Identical(v.typ, vt.typ) {
stmt.go#L271: seen[val] = append(seen[val], valueType{v.Pos(), v.typ})
stmt.go#L349: T = x.typ
stmt.go#L402: T = x.typ
stmt.go#L492: if !allNumeric(x.typ) {
stmt.go#L493: check.errorf(s.X, NonNumericIncDec, invalidOp+"%s%s (non-numeric type %s)", s.X, s.Tok, x.typ)
stmt.go#L612: if x.mode != invalid && !allBoolean(x.typ) {
stmt.go#L639: if x.mode != invalid && !Comparable(x.typ) && !hasNil(x.typ) {
stmt.go#L640: check.errorf(&x, InvalidExprSwitch, "cannot switch on %s (%s is not comparable)", &x, x.typ)
stmt.go#L647: x.typ = Typ[Bool]
stmt.go#L732: if isTypeParam(x.typ) {
stmt.go#L734: } else if IsInterface(x.typ) {
stmt.go#L840: if x.mode != invalid && !allBoolean(x.typ) {
typexpr.go#L145: x.typ = typ
typexpr.go#L262: typ := x.typ
typexpr.go#L279: typ := x.typ
typexpr.go#L532: if isUntyped(x.typ) || isInteger(x.typ) {
typexpr.go#L543: if isInteger(x.typ) {